import React, {Component} from 'react'
import {Button, ImageBackground, StatusBar, StyleSheet, View} from 'react-native'

export default class Startup extends Component {
    componentDidMount() {
        this.timeout = setTimeout(() => {
            console.log('切换');
        }, 3000)
    }

    componentWillUnmount() {
        this.timeout && clearTimeout(this.timeout);
    }

    render() {
        return (
            <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
                <StatusBar hidden={true}/>
                <ImageBackground
                    source={require('../../resources/images/launch_bg.png')}
                    style={{width: '100%', height: '100%'}}>
                    <Button
                        title='这是启动页'
                        style={{width: '50%', height: '50%'}}
                        onPress={() => {
                            this.props.navigation.replace('Boot')
                        }}/>
                </ImageBackground>

            </View>
        );
    }
}

const style = StyleSheet.create({})
